:root {
    --bg-color: #f7f8fa;
    --panel-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --input-bg: #f9fafb;
    --error-bg: #fee2e2;
    --error-text: #b91c1c;
    --error-border: #fca5a5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    height: 80vh;
    min-height: 550px;
    background-color: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.left-panel, .right-panel {
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.left-panel {
    width: 45%;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.right-panel {
    width: 55%;
    justify-content: center;
    align-items: center;
}

h1 { margin: 0 0 8px 0; }
.left-panel p { margin: 0 0 24px 0; color: var(--text-secondary); }

.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
input[type="password"], select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    font-size: 14px;
}

.image-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: var(--input-bg);
    transition: border-color 0.2s;
    margin-bottom: 16px;
}
.image-drop-zone.dragover { border-color: var(--primary-color); }
#image-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
#upload-placeholder { color: var(--text-secondary); }

#generate-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
}
#generate-btn:hover { background-color: var(--primary-hover); }
#generate-btn:disabled { background-color: #9ca3af; cursor: not-allowed; }

.spinner-sm {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.placeholder { text-align: center; color: var(--text-secondary); }
.hidden { display: none; }

#result-container { width: 100%; }
.prompt-box {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    min-height: 100px;
    max-height: 40vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 8px 0 16px 0;
    line-height: 1.6;
}
#copy-btn {
    padding: 8px 16px;
    background-color: #e5e7eb;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}
#copy-btn:hover { background-color: #d1d5db; }

.error {
    color: var(--error-text);
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-top: 16px;
}
